<template lang="">
  <div>
      <van-field label="新闻内容" v-model="form.title"/>
      <select v-model="form.dom_id">
          <option :value="i.id" v-for="i in data">{{i.name}}</option>
      </select>
      <van-button @click="postnews">添加</van-button>
  </div>
</template>

<script>
export default {
    data(){
        return{
            form:{},
            data:[]
        }
    },
    methods:{
        postnews(){
            this.axios.post('gameM',this.form).then(res=>{
                // alert('添加成功')
                this.form={}
            })
        },
        add(){
            this.axios.get('domesticM').then(res=>{
                this.data = res.data.list
                this.form.dom_id = this.data[0]['id']
            })
        }
    },
    mounted(){
        this.add()
    }
}
</script>

<style>

</style>